import Request from '@/comment/Request';

/**
 * 通过用户信息获取授权Token
 *
 * @param params
 * @returns {AxiosPromise<any>}
 */
export const authToken = (params) => {
    return Request.post('/auth/token', params);
};

/**
 * 授权用户基本信息
 * @param params
 * @returns {AxiosPromise<any>}
 */
export const userInfo = (params) => {
    return Request.get('/auth/user/info', {params});
};

/**
 * 销毁授权
 * @returns {AxiosPromise<any>}
 */
export const authDestroy = () => {
    return Request.post('/auth/destroy');
};

export default {
    authToken,
    userInfo,
    authDestroy
}